package com.hz.house.enums;

/**
 * 系统封面竞价类型
 * @author hsk
 */
public enum BidTypeEnum {

    /**竞价类型**/
    HOME_PAGE_BID(1, 5, "首页封面竞价"),
    BUILD_PAGE_BID(2, 1, "楼盘详情封面竞价");


    private Integer type;

    private int lowest;

    private String des;

    BidTypeEnum(Integer type, int lowest, String des) {
        this.type = type;
        this.lowest = lowest;
        this.des = des;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public int getLowest() {
        return lowest;
    }

    public void setLowest(int lowest) {
        this.lowest = lowest;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    /**
     * 通过 type获取
     * 默认使用 HOME_PAGE_BID
     * @param type
     * @return
     */
    public static BidTypeEnum getByType(Integer type){
        for (BidTypeEnum typeEnum: BidTypeEnum.values()){
            if (typeEnum.getType().equals(type)){
                return typeEnum;
            }
        }
        return BidTypeEnum.HOME_PAGE_BID;
    }

}
